# Contributor: k0r10n <k0r10n.dev@gmail.com>
# Contributor: Ivan Tham <pickfire@riseup.net>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=extra-cmake-modules
pkgver=6.7.0
pkgrel=0
pkgdesc="Extra CMake modules"
url="https://invent.kde.org/frameworks/extra-cmake-modules"
arch="noarch"
license="BSD-3-Clause"
depends="cmake"
makedepends="
	py3-sphinx
	samurai
	"
checkdepends="
	qt5-qtdeclarative-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
subpackages="$pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/extra-cmake-modules.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/extra-cmake-modules-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSphinx_BUILD_EXECUTABLE=/usr/bin/sphinx-build \
		-DBUILD_QTHELP_DOCS=ON
	cmake --build build
}

check() {
	# KDEFetchTranslations expects KDE's git setup
	ctest --test-dir build --output-on-failure -E "KDEFetchTranslations"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f37ce21f32e663e36b9a3f5dd8709b21926b2af08c9dceccd7559ae9ee1a4a1a710a425d5f9d2d8496da70af0258611c9a7ea584ee0f1f4ae4c889262f66d3b0  extra-cmake-modules-6.7.0.tar.xz
"
